package com.tuandai;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author 肖文
 * @Description ${DESCRIPTION}
 * @date 2018/3/27 20:26
 */
@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;

    @RequestMapping("/find/getName")
    public List<Map> find() {
        System.out.println(userService.getClass().getName());
        return userService.find();
    }

    @RequestMapping("/{name}")
    public String get(@PathVariable String name,@RequestParam int age) {
        return userService.get(name,age);
    }

    @RequestMapping("/say/hello")
    public String sayHello(@RequestParam String name) {
        return userService.sayHello(name);
    }
    @RequestMapping()
    public String getHello() {
        return userService.getHello();
    }
}
